﻿using ClassLibraryStande;
using Microsoft.AspNetCore.SignalR;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;

namespace WebApplication1.Myhub
{
    public class Hub1:Hub<ISumWay>
    {

        //被客户端调用  SendMessageAsync
        public async Task CallByClientAsync(string cliStr1, string cliStr2)
        {
            await Task.Delay(10);
            Console.WriteLine($"+++++++++++++客户端调用{MethodBase.GetCurrentMethod()?.Name}+++++++");
            Console.WriteLine($"参数1 {cliStr1}\t参数2 {cliStr2}");
            Console.WriteLine($"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
        }


        public async Task SendMessageAsync(string cliStr1)
        {
            await Task.Delay(10);
            Console.WriteLine($"+++++++++++++客户端调用{MethodBase.GetCurrentMethod()?.Name}+++++++");
            Console.WriteLine($"参数1 {cliStr1}");
            Console.WriteLine($"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
        }
    }
}
